how to add text on top of an image

103

how to add text on top of an image -

<!DOCTYPE html>
<html>
  
<head>
    <style>
        .gfg {
            margin: 3%;
            position: relative;
        }
  
        .first-txt {
            position: absolute;
            top: 17px;
            left: 50px;
        }
  
        .second-txt {
            position: absolute;
            bottom: 20px;
            left: 10px;
        }
    </style>
</head>
  
<body>
    <div class="image">
        <img src="image.type(ex. a.png, b.jpg)">
        <h3 class="first-txt">
            123
        </h3>
          
        <h3 class="second-txt">
            456
        </h3>
    </div>
</body>
  
</html>

Comments

Submit
0 Comments